﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Menu.aspx.cs" Inherits="TimKen.Web.Admin.Menu" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <base target="main-frame" />
    <link href="styles/general.css" rel="stylesheet" type="text/css" />
    <link href="styles/menu.css" rel="stylesheet" type="text/css" />

    <script type="text/javascript" src="../js/utils.js"></script>

</head>
<body>
    <div id="tabbar-div">
        <p>
            <span style="float: right; padding: 3px 5px;"></span><span class="tab-front" id="menu-tab">
                <%=GetLangString("Menu")%></span><span class="tab-back" id="help-tab" style="display: none"><%=GetLangString("Help")%></span>
        </p>
    </div>
    <div id="main-div">
        <div id="menu-list">
            <% if (CheckAction("1"))
               {%>
            <ul>
                <li class="explode">
                    <%=GetLangString("MenuProductManage")%></li>
                <ul>
                    <%if (CheckAction("88"))
                      { %>
                    <li class="menu-item"><a href="Product/Product_List.aspx">
                        <%=GetLangString("MenuProductList")%></a> </li>
                    <%} if (CheckAction("89"))
                      {%>
                    <li class="menu-item"><a href="ProductCategory/ProductCategory_Manage.aspx">
                        <%=GetLangString("MenuProductCategory")%></a></li>
                    <%} if (CheckAction("25"))
                      {%>
                    <li class="menu-item"><a href="PAttribute/POption_Manage.aspx">
                        <%=GetLangString("MenuProductOption")%></a></li>
                    <%} if (CheckAction("90"))
                      {%>
                    <li class="menu-item"><a href="Product/ProductPromote_List.aspx">
                        <%=GetLangString("MenuProductPromoteList")%></a></li>
                    <%} %>
                    
                     <%if (CheckAction("96"))
                      {%>
                    <li class="menu-item"><a href="Resource/Resource.aspx">
                        <%=GetLangString("MenuResourceManage")%></a></li>
                    <%} %>
                    
                      <%if (CheckAction("9"))
                      {%>
                    <li class="menu-item"><a href="Brand/Brand_List.aspx">
                        <%=GetLangString("MenuBrandManage")%></a></li>
                    <%} %>
                     <%if (CheckAction("9"))
                      {%>
                       <li class="menu-item"><a href="Recommend/Recommend_Manage.aspx">
                         <%--产品推荐管理--%><%=GetLangString("ProductRecommend") %></a> </li>
                          <%} %>
                </ul>
            </ul>
            <%} if (CheckAction("7"))
               { %>
            <ul>
                <li class="explode">
                    <%=GetLangString("MenuCustomerManage")%></li>
                <ul>
                    <%if (CheckAction("92"))
                      {%>
                    <li class="menu-item"><a href="Customer/Customer_List.aspx">
                        <%=GetLangString("MenuCustomerList")%></a> </li>
                    <%} %>
                     <%if (CheckAction("10"))
                      {%>
                        <li class="menu-item"><a href="Customer/Dealer_Manage.aspx">
                         <%--经销商维护--%><%=GetLangString("MenuDistributor") %></a> </li>    <%} %>
                    
                </ul>
            </ul>
            <%} if (CheckAction("2"))
               { %>
            <ul>
                <li class="explode">
                    <%=GetLangString("MeunArticleManage")%></li>
                <ul>
                    <% if (CheckAction("30"))
                       {%>
                    <li class="menu-item"><a href="Article/Article_List.aspx">
                        <%=GetLangString("MeunArticleManages")%></a> </li>
                    <%} %>
                <%--    <%if (CheckAction("31"))
                      { %>
                    <li class="menu-item"><a href="News/News_List.aspx">
                        <%=GetLangString("MeunNewsManage")%></a></li><%} %>--%>
                        
                        
                        <%if (CheckAction("32"))
                          { %>
                     
                      <li class="menu-item">
                      <a href="IndustrySolution/IndustrySolution_List.aspx">
                     
                       <%=GetLangString("IndustrySolutionManage")%></a></li>
                        <%} %>
                        
                        
                          <%if (CheckAction("33"))
                          { %>
                     
                      <li class="menu-item">
                      <a href="Help/Help_List.aspx">
                     
                       <%=GetLangString("HelpManage")%></a></li>
                        <%} %>
                        
                         
                      <%if (CheckAction("11"))
                          { %>
                      <li class="menu-item">
                      <a href="CompanyCulture/CompanyCulture_Edit.aspx">
                       <%--企业文化维护--%><%=GetLangString("MenuCompanCulture") %>
                      </a></li>
                         <%} %>
                       <%if (CheckAction("12"))
                          { %>
                        <li class="menu-item">
                      <a href="CompanyInfo/CompanyInfo_Edit.aspx">
                       <%--公司简介维护--%><%=GetLangString("MenuCompany") %>
                      </a></li>
                       <%} %>
                         <%if (CheckAction("13"))
                          { %>
                         <li class="menu-item">
                      <a href="PromotionInfo/PromotionInfo_Edit.aspx">
                       <%--促销公告--%><%=GetLangString("PromotionInfo") %>
                      </a></li>    <%} %>
                        <%if (CheckAction("14"))
                          { %>
                       <li class="menu-item">
                      <a href="Gift/GiftInfo_Edit.aspx">
                       <%--礼品兑换说明--%><%=GetLangString("GiftInfo") %>
                      </a></li>    <%} %>
                      
                        <%if (CheckAction("15"))
                          { %>
                       <li class="menu-item">
                      <a href="Industry/Industry_Edit.aspx">
                       <%--应用行业管理--%><%=GetLangString("Industry") %>
                      </a></li>    <%} %>
                </ul>
            </ul>
            <%} if (CheckAction("3"))
               { %>
            <ul>
                <li class="explode">
                    <%=GetLangString("MeunUserAccount")%></li>
                <ul>
                    <% if (CheckAction("84"))
                       {%>
                    <li class="menu-item"><a href="WebUser/WebUser_List.aspx">
                        <%=GetLangString("MenuWebUserList")%></a> </li>
                    <%} %>

                         
                   <% if (CheckAction("85"))
                       {%>
                    <li class="menu-item"><a href="UserAccount/User_List.aspx">
                        <%=GetLangString("MeunUserAccountList")%></a></li><%} %>
                        
                   <% if (CheckAction("97"))
                       {%>
                    <li class="menu-item"><a href="MessageBoard/MessageBoard_List.aspx">
                        <%=GetLangString("MessageManage")%></a> </li>
                    <%} %>
                      <% if (CheckAction("98"))
                       {%>
                    <li class="menu-item"><a href="Job/Job_List.aspx">
                        <%=GetLangString("JobManage")%></a> </li>
                    <%} %>
                    
                    
                </ul>
            </ul>
    
            
            <%} if (CheckAction("5"))
               { %>
            <ul>
                <li class="explode">
                    <%=GetLangString("MenuOrderManage")%></li>
                <ul>
                    <%if (CheckAction("86"))
                      { %>
                    <li class="menu-item"><a href="Order/Order_List.aspx">
                        <%=GetLangString("MenuOrderManage")%></a></li>
                    <%} %>
                </ul>
            </ul>
            <%} if (CheckAction("4"))
               { %>
            <ul>
                <li class="explode">
                    <%=GetLangString("MenuSystemConfiguration")%></li>
                <ul>
                    <% if (CheckAction("87"))
                       {%>
                    <li class="menu-item"><a href="TransType/TransType_List.aspx">
                        <%=GetLangString("MenuTransportationTypeList")%></a></li>
                    <%} if (CheckAction("93"))
                       {%>
                    <li class="menu-item"><a href="SystemConfig/SystemConfig_Edit.aspx">
                        <%=GetLangString("MenuSystemConfiguration")%></a></li>
                    <%} %>
                </ul>
            </ul>
           <%} if (CheckAction("8"))
               { %>
            <ul>
                <li class="explode">
                    <%=GetLangString("MenuAdministratorManage")%></li>
                <ul>
                    <li class="menu-item"><a href="Authority/DataAdmin_List.aspx">
                        <%=GetLangString("MenuDataAdministratorList")%></a></li>
                </ul>
            </ul>
     
            
            
                <%} if (CheckAction("95"))
               { %>
            <ul>
                <li class="explode">
                    <%=GetLangString("MenuInboxManage")%></li>
                <ul>
                    <li class="menu-item"><a href="Inbox/Inbox_List.aspx">
                        <%=GetLangString("MenuInbox")%></a></li>
                    <li class="menu-item"><a href="Inbox/InboxSend_List.aspx">
                        <%=GetLangString("MenuInboxSend")%></a></li>
                    <li class="menu-item"><a href="Inbox/Inbox_Add.aspx">
                        <%=GetLangString("MenuInboxAdd")%></a></li>
                </ul>
            </ul>
            <%} %>
            
             <% if (CheckAction("99")){%>
            
               <ul>
                <li class="explode">
                     <%=GetPageResource("SurveyManage")%></li>
                <ul>
                    <% if (CheckAction("100"))
                       {%>
                    <li class="menu-item"><a href="Survey/CreateSurvey.aspx">
                        <%=GetPageResource("CreateSurveyRight")%></a> </li>
                    <%} %>

                    <%if (CheckAction("100"))
                      { %>
                    <li class="menu-item"><a href="Survey/surveyoptions.aspx">
                         <%=GetPageResource("SurveySettingsTitle")%></a></li>
                         <%} %>
                      <% if (CheckAction("100"))
                       {%>
                    <li class="menu-item"><a href="Survey/surveycontentbuilder.aspx">
                         <%=GetPageResource("SurveyBuilderHyperlink")%></a> </li>
                    <%} %>
                      <% if (CheckAction("103"))
                       {%>
                    <li class="menu-item"><a href="Survey/ResultsReporting.aspx">
                         <%= GetPageResource("ResultsReportHyperlink")%></a> </li>
                    <%} %>
                                       <% if (CheckAction("104"))
                       {%>
                    <li class="menu-item"><a href="Survey/GlobalStats.aspx">
                         <%=GetPageResource("SurveyStatisticsTitle")%></a> </li>
                    <%} %>
                     <% if (CheckAction("105"))
                       {%>
                    <li class="menu-item"><a href="Survey/SurveyMailing.aspx">
                         <%=GetPageResource("MailingHyperlink")%></a> </li>
                    <%} %>
                    
                </ul>
            </ul>
            <%} 
           if (CheckAction("106")){%>
            
               <ul>
                <li class="explode">
                     <%=GetPageResource("gggl")%></li>
                <ul>
                    <% if (CheckAction("107"))
                       {%>
                    <li class="menu-item"><a href="Advertisement/Addvertisement.aspx?Imtype=1&Cz=add">
                        <%=GetPageResource("addPro")%></a> </li>
                    <%} %>

                    <%if (CheckAction("108"))
                      { %>
                    <li class="menu-item"><a href="Advertisement/BannerManger.aspx?Imtype=1">
                         <%=GetPageResource("ProManger")%></a></li>
                         <%} %>
                      <% if (CheckAction("109"))
                       {%>
                    <li class="menu-item"><a href="Advertisement/Addvertisement.aspx?Imtype=2&Cz=add">
                         <%=GetPageResource("addPp")%></a> </li>
                    <%} %>
                      <% if (CheckAction("110"))
                       {%>
                    <li class="menu-item"><a href="Advertisement/BannerManger.aspx?Imtype=2">
                         <%= GetPageResource("ppMange")%></a> </li>
                    <%} %>
                </ul>
            </ul>
            <%} %>
            
        </div>
        <div id="help-div" style="display: none">
            <h1 id="help-title">
            </h1>
            <div id="help-content">
            </div>
        </div>
    </div>

    <script language="JavaScript">
<!--
        var collapse_all = '<%=GetLangString("Collapse")%>';
        var expand_all = '<%=GetLangString("Expand")%>';
        var collapse = true;

        function toggleCollapse() {
            var items = document.getElementsByTagName('LI');
            for (i = 0; i < items.length; i++) {
                if (collapse) {
                    if (items[i].className == "explode") {
                        toggleCollapseExpand(items[i], "collapse");
                    }
                }
                else {
                    if (items[i].className == "collapse") {
                        toggleCollapseExpand(items[i], "explode");
                    }
                }
            }

            collapse = !collapse;

            document.getElementById('toggleImg').src = collapse ? 'images/menu_plus.gif' : 'images/menu_plus.gif';
            document.getElementById('toggleImg').alt = collapse ? collapse_all : expand_all;
        }

        function toggleCollapseExpand(obj, status) {
            if (obj.tagName.toLowerCase() == 'li' && obj.className != 'menu-item') {
                for (i = 0; i < obj.childNodes.length; i++) {
                    if (obj.childNodes[i].tagName == "UL") {
                        if (status == null) {
                            if (obj.childNodes[1].style.display != "none") {
                                obj.childNodes[1].style.display = "none";
                                obj.className = "collapse";
                            }
                            else {
                                obj.childNodes[1].style.display = "block";
                                obj.className = "explode";
                            }
                            break;
                        }
                        else {
                            obj.className = status;
                            obj.childNodes[1].style.display = (status == "explode") ? "block" : "none";
                        }
                    }
                }
            }
        }
        document.getElementById('menu-list').onclick = function(e) {
            var obj = Utils.srcElement(e);
            toggleCollapseExpand(obj);
        }

        document.getElementById('tabbar-div').onmouseover = function(e) {
            var obj = Utils.srcElement(e);

            if (obj.className == "tab-back") {
                obj.className = "tab-hover";
            }
        }

        document.getElementById('tabbar-div').onmouseout = function(e) {
            var obj = Utils.srcElement(e);

            if (obj.className == "tab-hover") {
                obj.className = "tab-back";
            }
        }

        document.getElementById('tabbar-div').onclick = function(e) {
            var obj = Utils.srcElement(e);

            var mnuTab = document.getElementById('menu-tab');
            var hlpTab = document.getElementById('help-tab');
            var mnuDiv = document.getElementById('menu-list');
            var hlpDiv = document.getElementById('help-div');

            if (obj.id == 'menu-tab') {
                mnuTab.className = 'tab-front';
                hlpTab.className = 'tab-back';
                mnuDiv.style.display = "block";
                hlpDiv.style.display = "none";
            }

            if (obj.id == 'help-tab') {
                mnuTab.className = 'tab-back';
                hlpTab.className = 'tab-front';
                mnuDiv.style.display = "none";
                hlpDiv.style.display = "block";

                loc = parent.frames['main-frame'].location.href;
                pos1 = loc.lastIndexOf("/");
                pos2 = loc.lastIndexOf("?");
                pos3 = loc.indexOf("act=");
                pos4 = loc.indexOf("&", pos3);

                filename = loc.substring(pos1 + 1, pos2 - 4);
                act = pos4 < 0 ? loc.substring(pos3 + 4) : loc.substring(pos3 + 4, pos4);
                loadHelp(filename, act);
            }
        }

        /**
        * 载入帮助内容
        */
        function loadHelp(filename, act) {
            var doc = createDocument();
            var path = 'help/' + helpLang + '/' + filename + ".xml";

            document.getElementById("help-title").innerHTML = '';
            document.getElementById("help-content").innerHTML = noHelp;
            try {
                doc.load(path);

                var items = doc.getElementsByTagName('section');

                for (i = 0; i < items.length; i++) {
                    if (items[i].getAttribute("id") == act) {
                        var title = items[i].getElementsByTagName("title");
                        document.getElementById("help-title").innerHTML = (Browser.isIE) ? title[0].text : title[0].textContent;

                        var content = items[i].getElementsByTagName("content");
                        document.getElementById("help-content").innerHTML = (Browser.isIE) ? content[0].text : content[0].textContent;

                        break;
                    };
                }
            }
            catch (e) {
                alert(e.message);
            }
        }

        /**
        * 创建XML对象
        */
        function createDocument() {
            var xmlDoc;

            // create a DOM object
            if (window.ActiveXObject) {
                try {
                    xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");
                }
                catch (e) {
                    try {
                        xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
                    }
                    catch (e) {
                        try {
                            xmlDoc = new ActiveXObject("Msxml2.DOMDocument.4.0");
                        }
                        catch (e) {
                            try {
                                xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
                            }
                            catch (e) {
                                alert(e.message);
                            }
                        }
                    }
                }
            }
            else {
                if (document.implementation && document.implementation.createDocument) {
                    xmlDoc = document.implementation.createDocument("", "doc", null);
                }
                else {
                    alert("Create XML object is failed.");
                }
            }
            xmlDoc.async = false;

            return xmlDoc;
        }

        var Browser = new Object();

        Browser.isMozilla = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined') && (typeof HTMLDocument != 'undefined');
        Browser.isIE = window.ActiveXObject ? true : false;
        Browser.isFirefox = (navigator.userAgent.toLowerCase().indexOf("firefox") != -1);
        Browser.isSafari = (navigator.userAgent.toLowerCase().indexOf("safari") != -1);
        Browser.isOpera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1);

        var Utils = new Object();

        Utils.srcElement = function(e) {
            if (typeof e == "undefined") e = window.event;
            var src = document.all ? e.srcElement : e.target;

            return src;
        }

        Utils.fixEvent = function(e) {
            var evt = (typeof e == "undefined") ? window.event : e;
            return evt;
        }
//-->
    </script>

</body>
</html>
